package com.lemonPiggy.UDForm.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.stereotype.Service;

import javax.management.Query;
import java.util.HashMap;
import java.util.Map;
@Service
public class MongoDBUtils {
    @Autowired(required=false)
    private MongoTemplate mongoTemplate;

    public  void  save(){
        Map<String,String> inmap=new HashMap<String,String>();
        inmap.put("name","张山");
        inmap.put("job","法外狂徒");
        mongoTemplate.save(inmap);
    }

    public  void main(String[] args) {
       this.save();
    }
}
